from machine import ADC, Pin
import time

# 初始化ADC
adc = ADC(Pin(34))  # 假设将传感器连接至GPIO34
adc.atten(ADC.ATTN_11DB)  # 配置最大量程为3.3V

while True:
    value = adc.read()
    print("Soil Moisture:", value)
    time.sleep(2)  # 每两秒读取一次
